﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.PO;

namespace Com.CMS263.DAO
{
    public class TvStationPeopleDAO:BaseService
    {
        public IList<Com.CMS263.PO.TvStationPeople> FindListByTvId(int tvId,string count)
        {
            string hql = "from TvStationPeople where TvStationId="+tvId;
            if (count=="all")
            {
                return FindList<TvStationPeople>(hql, null, null, null);
            }
            else
            {
                return FindList<TvStationPeople>(hql, null, 0, int.Parse(count));
            }
        }

        public int GetResultCount()
        {
            try
            {
                string hql = "select count(*) from TvStationPeople";
                return int.Parse(GetValue(hql).ToString());
            }
            catch
            {

                return 0;
            }
        }

        public IList<TvStationPeople> FindList(int page, int pagesize)
        {
            string hql = "from TvStationPeople";            
            return FindList<TvStationPeople>(hql, null, null, null);
           
        }
    }
}
